﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YuFeng.Models;

namespace YuFeng.Repositories
{
    public sealed class YuFengContext : DbContext
    {
        public YuFengContext()
            : base("DB_YuFeng")
        {
        }
        public YuFengContext(string nameOrConnectionString)
            : base(nameOrConnectionString)
        {
            Configuration.LazyLoadingEnabled = false;
        }
        public void Commit()
        {
            base.SaveChanges();
        }
        public DbSet<Region> Regions { get; set; }

        public DbSet<Models.User.User> Users { get; set; }
        public DbSet<Models.User.UserRole> UserRoles { get; set; }
        public DbSet<Models.New.News> News { get; set; }
        public DbSet<Models.Product.Product> Products { get; set; }
        public DbSet<Models.Product.ProductCategory> ProductCategorys { get; set; }
        public DbSet<Models.Banner.Banner> Banners { get; set; }
    }
}
